import VueRouter from "vue-router";
import Home from "@/pages/Home.vue";
import School from "@/pages/School.vue";
import School_i from "@/pages/School_i.vue";
import Volunteer from "@/pages/Volunteer.vue";
import Major from "@/pages/Major.vue";
import College from "@/pages/collageMain.vue";
import MajorMain from "@/pages/majorMain.vue";
import Search from "@/pages/Search.vue";
import UserMessage from "@/components/UserMessage.vue";
import Filter from "@/pages/Filter.vue";
import City from "@/components/City.vue";
import Type from "@/components/Type.vue";

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    component: Home,
  },
  {
    path: "/school",
    component: School,
    redirect: "school_i",
    children: [
      {
        path: "/school_i",
        component: School_i,
      },
      {
        path: "/major",
        component: Major,
      },
    ],
  },
  {
    path: "/volunteer",
    component: Volunteer,
  },
  {
    path: "/college/:id",
    component: College,
  },
  {
    path: "/majormain/:id",
    component: MajorMain,
  },
  {
    path: "/search/",
    component: Search,
  },
  {
    path: "/usermsg",
    component: UserMessage,
  },
  {
    path: "/filter",
    component: Filter,
    redirect: "city",
    children: [
      {
        path: "/city",
        component: City,
      },
      {
        path: "/type",
        component: Type,
      },
    ],
  },
];
const router = new VueRouter({
  mode: "hash",
  routes: routes,
});
export default router;
